
"""
    ROOT.settings.py
        path('api/user/', include(('users.urls', 'users'), namespace='users')),
"""

from django.urls import path, include
from users.views import user, menu, permission, organization, role
from rest_framework import routers

router = routers.SimpleRouter()
router.register(r'user', user.UserProfileModelView)
router.register(r'menu', menu.MenuModelView)
router.register(r'permission', permission.PermissionModelView)
router.register(r'organization', organization.OrganizationModelView)
router.register(r'role', role.RoleModelView)


urlpatterns = [
    path('api/', include(router.urls)),
    path('api/auth/login/', user.UserAuthView.as_view()),  # jwt(json web token) 验证
    path('api/auth/info/', user.UserInfoView.as_view()),  # 用户详情
    path('api/auth/menus/', user.UserBuildMenuView.as_view()),  # 绑定当前用户菜单信息
    path('api/tree/role/', role.OrganizationRoleTreeView.as_view()),  # 角色目录树```````````````
    path('api/tree/organization/', organization.OrganizationTreeView.as_view()),  # 组织架构目录树
    path('api/tree/organization/user/', organization.OrganizationRoleTreeView.as_view()),  # 组织架构关联用户目录树
    path('api/tree/menus/', menu.MenuModelTreeView.as_view()),  # 菜单树
    path('api/tree/permissions/', permission.PermissionModelTreeView.as_view()),  # 菜单树
]
